<template>
  <div class="banner">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item, index) in imgs" :key="index">
        <img :src="item.bannerUrl" alt="" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
  
  <script>
import { banner_list } from "../../utils/api";
export default {
  data() {
    return {
      imgs: [],
    };
  },
  mounted() {
    banner_list().then((res) => {
      this.imgs = res.data.list;
    });
  },
};
</script>
  
  <style>
.banner {
  margin: 8px;
  border-radius: 5px;
}
.my-swipe .van-swipe-item {
  height: 100%;
  width: 100%;
}
.banner img {
  width: 100%;
}
</style>